﻿@model LeadMaster.Models.LeadStatQuestions

@using (Ajax.BeginForm(
   "EditStatQuestion", "LeadBuilder", null,    
    new AjaxOptions
{
HttpMethod="Post",
UpdateTargetId = "statquestions"
}, new { @id = "formAskStatQuestion" }))
{
    @Html.ValidationSummary(true)
    @Html.HiddenFor(model => model.LeadStatID)
    @Html.HiddenFor(model => model.LeadStatQuestionsID)
    <fieldset>
    <legend>Edit Statutory Question</legend>

<div>
<table class="listtable contactstable" cellspacing="0" cellpadding="0" style="width: 1000px;" id="enquirylist">
    <tr>
    <th style="text-align: left"><label>Question</label></th>
    <td>
    @Html.TextAreaFor(model => model.Question, new { @class = "notes" })
    @Html.ValidationMessageFor(model => model.Question)
    </td>
    </tr>
    <tr>
    <th style="text-align: left"><label>Answer Type</label></th>
    <td>
    @Html.DropDownListFor(model => model.AnswerType, (SelectList)ViewBag.answerTypeList, "Please select Answer Type")
    Dropdown ? <input type="checkbox" name="DropDown" id="DropDown" 
    @if (Model.DropDown==true)
	{
		 @:checked
	} 
    value="true"
    />
    </td>
    </tr>
    <tr>
    <th style="text-align: left"><label>Character-based or Dropdown List options</label></th>
    <td>@Html.TextAreaFor(model => model.AcceptedAnswerChar, new { @class="notes" })</td>
    </tr>
    <tr>
    <tr>
    <th style="text-align: left"><label>Answer Logic</label></th>
    <td>
        <input id="groupAcceptedAnswerYes" type="radio" name="AcceptedAnswerBool" value="true"/>Yes
        <input id="groupAcceptedAnswerNo" type="radio" name="AcceptedAnswerBool" value="false"/>No
    </td>
    </tr>

    <tr>
    <th style="text-align: left"><label>Answer Numeric From</label></th>
    <td>@Html.TextBoxFor(model => model.AcceptedAnswerIntFrom)</td>
    </tr>
    <tr>
    <th style="text-align: left"><label>Answer Numeric To</label></th>
    <td>@Html.TextBoxFor(model => model.AcceptedAnswerIntTo)</td>
    </tr>
    <tr>
    <th style="text-align: left"><label>Mandatory</label></th>
    <td>@Html.CheckBoxFor(model => model.Mandatory)</td>
    </tr>
    <tr>
    <th style="text-align: left"><label>Caller script note</label></th>
    <td>
        @Html.TextAreaFor(m => m.Notes, new { @class="notes"})
    </td>
    </tr>
    <tr>
    <th style="text-align: left"><label>Display Order</label></th>
    <td>@Html.TextBoxFor(model => model.DisplayOrder)</td>
    </tr>
</table>
</div>
</fieldset>
}

<script type="text/javascript">
    $(document).ready(function () {
        $("#answerTypeList").attr('name', 'AnswerType')

        if ("@(Model.AcceptedAnswerBool)" == "True") {
            $("#groupAcceptedAnswerYes").attr("checked", "checked");
        }
        else if ("@(Model.AcceptedAnswerBool)" == "False") {
            $("#groupAcceptedAnswerNo").attr("checked", "checked");
        }

    });
</script>